//引入依赖的配置文件模块
require(["config"],function(){
	//引入依赖模块
	require(["jquery","template","header","carousel"],function($,template){
		function Index() {
			this.loadCarousel();
			this.renderList();
		}
		
		$.extend(Index.prototype , {
			loadCarousel : function(){
				
				$("#banner-one-right").carousel({
					imgs:[
						{href:"#" , src:"/images/lb1.jpg"},
						{href:"#" , src:"/images/lb2.jpg"}
					],
					width:909,
					height:442,
					duration:3000
				});
			},
			
			renderList : function(){
				$.ajax("http://rap2api.taobao.org/app/mock/94983/example/1539743129515")
					.done(function(data){
						var data = data.res_body;
						console.log(data);
						var html = template("list_template" , data);
						
						$(".main").html(html);
					});
			}
			
			
		});
		new Index();
	});
	
});
